zcf-simde-crc32c
authorDebian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
Wed, 1 Oct 2025 18:43:25 +0000 (14:43 -0400)
committerAaron M. Ucko <ucko@debian.org>
Wed, 1 Oct 2025 18:43:25 +0000 (14:43 -0400)
Gbp-Pq: Name zcf-simde-crc32c

c++/src/util/compress/zlib_cloudflare/deflate.c

index cb495d3b8fcab39a18501851d47fd172d6357d97..9b6fa1d97c94bc4a9cd2a6fd19e8f10c6b279e7b 100644 (file)
@@ -129,27 +129,11 @@ static const config configuration_table[10] = {
 /* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */
 #define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
 
-#ifdef __aarch64__
-
-#include <arm_neon.h>
-#include <arm_acle.h>
-static uint32_t hash_func(deflate_state *s, void* str) {
-    return __crc32cw(0, *(uint32_t*)str) & s->hash_mask;
-}
-
-#elif defined __x86_64__ || defined _M_AMD64
-
-#include <immintrin.h>
+#include <simde/x86/sse4.2.h>
 static uint32_t hash_func(deflate_state *s, void* str) {
-    return _mm_crc32_u32(0, *(uint32_t*)str) & s->hash_mask;
+    return simde_mm_crc32_u32(0, *(uint32_t*)str) & s->hash_mask;
 }
 
-#else
-
-#error "Only 64-bit Intel and ARM architectures are supported"
-
-#endif
-
 /* ===========================================================================
  * Insert string str in the dictionary and return the previous head
  * of the hash chain (the most recent string with same hash key).